/*
 * Copyright 2005-2007 Pulse Technologies. Tutti i diritti riservati.
 */

package org.obsidianrad.server.services.obj2db.commodities;


import java.io.Serializable;

import org.obsidianrad.server.services.ObsModel;

/**
 * 
 * @author eliosh
 * @version $Rev: 4 $
 * @lastautorcommit $Author: eliosh $
 * @lastdatecommit $Date: 2009-10-31 12:37:28 +0100(sab, 31 ott 2009) $
 */
public class BasePagingLoadResult<T extends ObsModel> implements Serializable, PagingLoadResult<T> {

	private static final long serialVersionUID = -6684539582474956670L;
	
	protected int offset = 0;
	protected int totalLength = 0;
	protected T[] list;

	public BasePagingLoadResult() {

	}

	/**
	 * Creates a new paging load result.
	 * 
	 * @param data
	 *            the data
	 */
	public BasePagingLoadResult(T[] data) {
		this.list = data;
	}

	/**
	 * Creates a new paging load result.
	 * 
	 * @param data
	 *            the data
	 * @param offset
	 *            the offset
	 * @param totalLength
	 *            the total length
	 */
	public BasePagingLoadResult(T[] data, int offset, int totalLength) {
		this(data);
		this.offset = offset;
		this.totalLength = totalLength;
	}

	public int getOffset() {
		return offset;
	}

	public int getTotalLength() {
		return totalLength;
	}

	public void setOffset(int offset) {
		this.offset = offset;
	}

	public void setTotalLength(int totalLength) {
		this.totalLength = totalLength;
	}

	public T[] getData() {
		return list;
	}

	public void setData(T[] list) {
		this.list = list;
	}

}
